/*
 * main.c
 *
 *  Created on: Feb 17, 2013
 *      Author: justin
 */

#include "project.h"

#define spiPort1 1

int main() {
	spi_init();		//
	sbi(DDRB,spiPort1);
	//configure cs for DDS
	ddsInit();

	int frequency = 16000, old_freq;
	while (1) {

		if (old_freq != frequency) {
//		    Serial.print(frequency);
//		    Serial.print("Hz : ");
//			Set_frequency(frequency);
			old_freq = frequency;
//			delay(200);

			cbi(PORTB,DDB2);
			//set cs low to start spi rx
			ddsSetFrequency(frequency);
			sbi(PORTB,DDB2);

		}


	}
	return 0;
}
